package demo3;

public class Person implements Comparable<Person>{

    public String name1;
    public int age;
    public double score;

    public Person(String name, int age, double score) {
        this.name1 = name;
        this.age = age;
        this.score = score;
    }

    @Override
    public String toString() {
        return "Person{" +
                "name='" + name1 + '\'' +
                ", age=" + age +
                ", score=" + score +
                '}';
    }

    @Override
    public int compareTo(Person o) {
        return this.name1.compareTo(o.name1);
    }
}
